// pages/detail/detail.js
var app = getApp();
var util = require('../../utils/util.js');
const config = require('../../utils/config.js');
var my = require("../../utils/request.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {

    //接口地址
    myactivity: "activity/mylist",
    myList:[]

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function () {
    var that = this
    wx.showToast({
      title: '加载中',
      icon: 'loading',
      duration: 500
    })
    that.myactivity();
  },
  myactivity: function () {
    var that = this;
    my.request({
      url: that.data.myactivity,
      //data: params,
      method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {

        console.log(res)

        that.setData({
          "myList": res.data.data
        })
      }

    })

  },
  evaluate:function(e){
    console.log(e)
    console.log(e.currentTarget.dataset.cid)
    let cid = e.currentTarget.dataset.cid
    wx.navigateTo({
      url: '../evaluate/evaluate?cid='+cid
    });

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function (options) {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function (options) {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function (options) {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function (options) {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function (options) {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function (options) {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function (options) {

  }
})